package qianFeng.day1;

import java.util.Scanner;

public class passwd {
    public static void main(String[] args) {
        String user="admin";
        String passwd="666666";
        Scanner input=new Scanner(System.in);
        for (int i=0;i<3;i++){
            System.out.print("请输入用户名：");
            String u=input.next();
            System.out.print("请输入密码：");
            String p=input.next();
            if (user.equals(u)&&passwd.equals(p)){
                System.out.println("登录成功！");
                break;
            }
            else {
                System.out.println("用户名或密码错误！");
                System.out.println("你还有"+(2-i)+"次机会！");
            }
        }
    }
}
